# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Maintainer: Sagar Acharya <sagar@hyperbola.info>

_prj=trellis
_targets=ECP5
_commit=fdf4bf275a7402654bc643db537173e2fbc86103
pkgname=prj$_prj-db
pkgver=r20210630
pkgrel=1
pkgdesc='Project Trellis (Lattice ECP5 bit-stream format) database'
arch=('x86_64')
url="https://github.com/YosysHQ/$pkgname"
license=('CC0-1.0')
makedepends=('git')
source=("https://github.com/YosysHQ/prjtrellis-db/archive/${_commit}.tar.gz")
sha512sums=('8129d883af99f8d4ddfe85b379606e716eb2cb71512e3832cd69039bb5262bf594da0971065142dcd29dfc3cc507a60a3b731776e219d078c24600746c550dd7')

package() {
  cd $pkgname-${_commit}

  install -dm 755 "$pkgdir"/usr/share/$_prj/database
  cp -r --no-preserve=ownership devices.json $_targets "$pkgdir"/usr/share/$_prj/database/

  install -Dm 644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
